/*
 * MODULE NAME:    mgr_devdb.h
 * DESCRIPTION:    Host Manager Device Database Functionality
 * AUTHOR:         Martin Mellody
 * DATE:           23 May 2000
 *
 * SOURCE CONTROL: $Id: mgr_devdb.h,v 1.2 2009/08/25 06:04:50 jianguo Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2002 RDA Microelectronics.
 *     All rights reserved.
 *
 */


#ifndef __MGR_DEVDB_H
#define __MGR_DEVDB_H


/* NON-API START */
/* below this line will not open to customer */

#define MGR_DEVICE_FLAG_UNUSED          (0)
#define MGR_DEVICE_FLAG_USED          (0x100)
#define MGR_DEVICE_FLAG_LOCKED          (0x200)
#define MGR_DEVICE_FLAG_NEWDEVICE        (0x400)

struct st_t_BT_ConnectionInfo;

typedef struct st_t_BT_DeviceInfo {
        t_bdaddr bdAddress;
        u_int16 deviceState; /* combined with device record flags */
        u_int32 classOfDevice;
        s_int8 rssi;
        u_int8 name_length;
        u_int8 name[MGR_MAX_REMOTE_NAME_LEN];
        u_int8 linkKeyType; /* MGR_COMBINATION | MGR_LOCALUNITKEY | MGR_REMOTEUNITKEY */
        u_int8 linkKey[LINKKEY_SIZE];

	/* User API level members end here ... */
        u_int8 device_index;

        u_int8 pageScanRepetitionMode;
        u_int8 pageScanPeriodMode;
        u_int8 pageScanMode;
        u_int16 clockOffset;

        u_int8 OOB_R[LINKKEY_SIZE];
        u_int8 OOB_C[LINKKEY_SIZE];
        u_int8 io_capability;

        struct st_t_BT_ConnectionInfo *pConnectInfo;
} t_MGR_DeviceInfo;


void rdabt_mgr_initialise_devicelist(void);
void rdabt_mgr_free_all_devicelist(void);

struct st_t_BT_DeviceInfo *rdabt_mgr_find_deviceEntryByAddress(t_bdaddr addr);
struct st_t_BT_DeviceInfo *rdabt_mgr_return_deviceEntryByAddress(t_bdaddr addr);
void rdabt_mgr_removeDeviceByFlag(u_int16 withFlag, u_int16 withoutFlag);
struct st_t_BT_DeviceInfo *rdabt_mgr_addDeviceEntry(t_bdaddr addr);

#endif /*__MGR_DEVDB_H*/

